package com.vincce.fitness.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: henry
 * Date: 8/16/13
 * Time: 1:21 PM
 * To change this template use File | Settings | File Templates.
 */
public class WechatButton {

	private List<WechatButton> button;

	private String type;

	private String name;

	private String key;

	private String url;

	private List<WechatButton> sub_button;

	public WechatButton() {
	}

	public WechatButton(String name) {
		this.name = name;
	}

	public WechatButton(String type, String name, String key) {
		this.type = type;
		this.name = name;
		this.key = key;
	}

	public WechatButton(String type, String name, String key, String url) {
		this.type = type;
		this.name = name;
		this.key = key;
		this.url = url;
	}

	public List<WechatButton> getButton() {
		return button;
	}

	public void setButton(List<WechatButton> button) {
		this.button = button;
	}

	public WechatButton(WechatButton... buttons) {
		if (getButton() == null) {
			setButton(new ArrayList<WechatButton>());
		}
		for (WechatButton button1 : buttons) {
			getButton().add(button1);
		}
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<WechatButton> getSub_button() {
		return sub_button;
	}

	public void setSub_button(List<WechatButton> sub_button) {
		this.sub_button = sub_button;
	}

	public WechatButton addButton(WechatButton... buttons) {
		if (getSub_button() == null) {
			setSub_button(new ArrayList<WechatButton>());
		}
		for (WechatButton button1 : buttons) {
			getSub_button().add(button1);
		}
		return this;
	}
}
